//
//  UIButton+Extension.m
//  guahao
//
//  Created by osx on 16/10/4.
//  Copyright © 2016年 osx. All rights reserved.
//

#import "UIButton+Extension.h"

@implementation UIButton (Extension)

+(UIButton*)initWithTitle:(NSString*) title color:(UIColor*)color {
    
    UIButton *bt = [[UIButton alloc] init];
    [bt setTitle:title forState:UIControlStateNormal];
    [bt setTitleColor:color forState:UIControlStateNormal];
    
    return bt;
}

+(UIButton*)initWithTitle:(NSString*) title{

    UIButton *bt = [[UIButton alloc] init];
    [bt setTitle:title forState:UIControlStateNormal];
    
    return bt;
}

+(UIButton*)initWithTitle:(NSString*) title backImagename:(NSString*)backImageName{

    UIButton *bt = [[UIButton alloc] init];
    [bt setTitle:title forState:UIControlStateNormal];
    [bt setBackgroundImage:[UIImage imageNamed:backImageName] forState:UIControlStateNormal];
    
    return bt;
}

+(UIButton*)initWithTitle:(NSString *)title fontsize:(CGFloat)fontsize color:(UIColor *)color{
    
    UIButton* bt = [[UIButton alloc] init];
    [bt setTitle:title forState:UIControlStateNormal];
    [bt.titleLabel setFont:[UIFont systemFontOfSize:fontsize]];
    [bt setTitleColor:color forState:UIControlStateNormal];
    
    return bt;
}
@end
